package com.beijing.cyou.model;

import com.beijing.cyou.utils.NotNullHelps;
import lombok.Data;

import java.util.Date;


@Data
public class UserToken {

    private Long id ;

    private Long userId ;

    private String userName ;

    private String userEmail ;

    private String mailPrefix ;

    private String userToken ;

    private Date tokenDate ;

    private String tokenInfo ;

    private String remarks ;

    public String findMailPrefix(){
        if (NotNullHelps.isNotNull(userEmail) == false) {
            return mailPrefix;
        } else {
            return userEmail.split("@")[0];
        }
    }

}
